package com.lams.action.archive;

import java.util.HashMap;
import java.util.Map;

import com.lams.action.SubAction;
import com.lams.service.archive.IAssetFacade;
import com.lams.util.ResultEntity;

public class AssetAction extends SubAction {
	private static final long serialVersionUID = -1829686600874050660L;
	private String ASSET_ID;
	private String ASSET_TYPE;
	private String ASSET_NO;
	private String ASSET_NAME;
	private String ASSET_PRICE;
	private String BUYDATE;
	private String MADE_FAC;
	private IAssetFacade af;
	private Map params = new HashMap();;
	
	public String queryAssets(){
		ResultEntity result = af.queryAssets(this.getStart(), this.getLimit(), params);
		this.setResult(ResultEntity.decode(result));
		return SUCCESS;
	}

	public String addOrUpdateAsset(){
		ResultEntity result = af.addOrUpdateAsset(params);
		this.setResult(ResultEntity.decode(result));
		return SUCCESS;
	}
	
	public String getASSET_ID() {
		return ASSET_ID==null||"".equals(ASSET_ID)?"-1":ASSET_ID;
	}


	public void setASSET_ID(String aSSET_ID) {
		ASSET_ID = aSSET_ID;
		params.put("ASSET_ID", this.getASSET_ID());
	}


	public String getASSET_TYPE() {
		return ASSET_TYPE==null || "".equals(ASSET_TYPE)?"-1":ASSET_TYPE;
	}


	public void setASSET_TYPE(String aSSET_TYPE) {
		ASSET_TYPE = aSSET_TYPE;
		params.put("ASSET_TYPE", this.getASSET_TYPE());
	}


	public IAssetFacade getAf() {
		return af;
	}


	public void setAf(IAssetFacade af) {
		this.af = af;
	}


	public void setASSET_NO(String aSSET_NO) {
		ASSET_NO = aSSET_NO;
		params.put("ASSET_NO", this.getASSET_NO());
	}


	public void setASSET_NAME(String aSSET_NAME) {
		ASSET_NAME = aSSET_NAME;
		params.put("ASSET_NAME", this.getASSET_NAME());
	}


	public void setASSET_PRICE(String aSSET_PRICE) {
		ASSET_PRICE = aSSET_PRICE;
		params.put("ASSET_PRICE", this.getASSET_PRICE());
	}


	public void setBUYDATE(String bUYDATE) {
		BUYDATE = bUYDATE;
		params.put("BUYDATE", this.BUYDATE);
	}


	public void setMADE_FAC(String mADE_FAC) {
		MADE_FAC = mADE_FAC;
		params.put("MADE_FAC", this.getMADE_FAC());
	}


	public String getASSET_NO() {
		return ASSET_NO;
	}


	public String getASSET_NAME() {
		return ASSET_NAME;
	}


	public String getASSET_PRICE() {
		return ASSET_PRICE;
	}


	public String getBUYDATE() {
		return BUYDATE;
	}


	public String getMADE_FAC() {
		return MADE_FAC;
	}


	public Map getParams() {
		return params;
	}
	
	
	
}
